/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __IMPL_MGR_H__
#define __IMPL_MGR_H__

#include "../interface/head.h"
#include "../tools/head.h"

namespace xos_config
{

    class mgr : public i_config
    {
    public:
        typedef xos::release_impl< mgr > T;

    public:
        mgr();
        ~mgr();

    public:
        static int static_init( xos_container::i_container * pContainer, i_config ** ppv );
        static xos_container::i_container * container();
        static mgr * get();

    public:
        xos::i_release * set( const char * lpszId, xos::i_release * pProp, bool bAutoRelease );
        xos::i_release * remove( const char * lpszId );
        xos::i_release * get( const char * lpszId );

    protected:
        xos_box::i_str_property * m_pProperty;
        thread_lock m_lock;

    public:
        int put_back_to_pool();
        int init();
        int term();

    };

} // xos_config

#endif // __IMPL_MGR_H__
